import { requestAjax } from "./foodConfig.js";

// 餐饮列表
export const foodList = (data) => {
  return requestAjax("/api/v1/food/list", data, "GET");
};
// 餐饮详情
export const foodGet = (data) => {
  return requestAjax(`/api/v1/food/get/${data.id}`, data, "GET");
};
//
// 提交餐饮订单
export const submitFoodOrder = (data) => {
  return requestAjax(`/api/v1/order/user/submitOrder`, data, "POST");
};
// 餐饮创建支付
export const payTradeByUser = (data) => {
  return requestAjax(`/api/v1/payment/payTradeByUser`, data, "POST");
};
// 订单列表
export const myOrderList = (data) => {
  return requestAjax("/api/v1/order/user/myOrderList", data, "GET");
};
// chooseFoodTable
export const chooseFoodTable = (data) => {
  return requestAjax("/api/v1/foodTable/chooseFoodTable", data, "GET");
};
export const foodOrderDetail = (data) => {
  return requestAjax(`/api/v1/order/user/detail/${data.id}`, data, "GET");
};
// choosestoreTable
export const chooseStore = (data) => {
  return requestAjax("/api/v1/store/chooseStore", data, "GET");
};
//机构用户端-根据父订单ID查询支付结果(SUCCESS：已支付/USERPAYING: 正在支付中，如输入密码等/FAIL：明确支付失败)
export function payTradeByStaffByOrderId(data) {
  return requestAjax(
    `/api/v1/payment/payTradeByStaffByOrderId/${data.id}`,
    data,
    "GET"
  );
}
export const foodTableInfo = (data) => {
  return requestAjax(`/api/v1/foodTable/get/${data.id}`, data, "GET");
};
